package com.projet.parse;

import java.sql.Connection;
import java.sql.DriverManager;

public class Hz {
    /**
     * 驱动
     */
    private static String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";

    /**
     * 地址
     */
    private static String url = "jdbc:sqlserver://192.168.30.133:1433;DatabaseName=ByPrjHzjd;encrypt=false";

    /**
     * 名称
     */
    private static String username = "sa";

    /**
     * 密码
     */
    private static String password = "Qpkj@66";


    /**
     * 取得连接
     *
     * @return
     */
    public synchronized static Connection getConn() throws Exception {
        //创建连接
        Class.forName(driver);
        return DriverManager.getConnection(url, username, password);

    }

}
